ccR.Add_Rotation(
	3,
	"Ankhy_BASIC_Guardian",
	"BASIC Rotation.\n\nMade by Ankhy"
)

function Ankhy_BASIC_Guardian()

	if (ccR.Player.IsInCombat() or (ccR.Player.IsInGroup() and ccR.Target.IsInCombat())) and ccR.Target.Is.Attackable() then
		-- Survival
		if ccR.Spell.IsReady("Savage Defense") and not ccR.Player.Has.Buff("Barkskin") and not ccR.Player.Has.Buff("Savage Defense") then ccR.Cast.Spell("Savage Defense") end	
		if ccR.Spell.IsReady("Barkskin") and not ccR.Player.Has.Buff("Barkskin") and not ccR.Player.Has.Buff("Bristling Fur") then ccR.Cast.Spell("Barkskin") end
		if ccR.Spell.IsReady("Bristling Fur") and not ccR.Player.Has.Buff("Barkskin") and not ccR.Player.Has.Buff("Savage Defense") then ccR.Cast.Spell("Bristling Fur") end	
		if ccR.Spell.IsReady("Maul") and ccR.Player.Has.Buff("Tooth and Claw") then ccR.Cast.Attack("Maul") end
		if ccR.Spell.IsReady("Berserk") and ccR.Player.HasBuff("Pulverize") and ccR.Player.BuffDuration("Pulverize") > 10 then ccR.Cast.Spell("Berserk") end
		if ccR.Spell.IsReady("Frenzied Regeneration") and ccR.Player.Rage() >= 80 and ccR.Player.Health() <= 80 then ccR.Cast.Spell("Frenzied Regeneration") end
		if ccR.Spell.IsReady("Cenarion Ward") then ccR.Cast.Spell("Cenarion Ward") end
		if ccR.Spell.IsReady("Renewal") and ccR.Player.Health() < 30 then ccR.Cast.Spell("Renewal") end
		if ccR.Spell.IsReady("Rejuvenation") and not ccR.Unit.Has.MyBuff("player", "Rejuvenation") and ccR.Player.Has.Buff("Heart of the Wild") then ccR.Cast.Spell("Rejuvenation") end
		if ccR.Spell.IsReady("Rejuvenation") and ccR.Player.Has.Buff("Heart of the Wild") and ccR.Player.BuffDuration("Heart of the Wild") <= 3.6 then ccR.Cast.Spell("Rejuvenation") end
		if ccR.Spell.IsReady("Nature's Vigil") then ccR.Cast.Spell("Nature's Vigil") end
		if ccR.Spell.IsReady("Healing Touch") and ccR.Player.Health() < 99 and ccR.Player.HasBuff("Dream of Cenarius") then ccR.Cast.Spell("Healing Touch") end
		if ccR.Spell.IsReady("Pulverize") and ccR.Spell.CanAttack("Pulverize") and (ccR.Player.HasBuff("Pulverize") and ccR.Player.BuffDuration("Pulverize") <= 3.6 or not ccR.Player.HasBuff("Pulverize")) then ccR.Cast.Attack("Pulverize") end
		if ccR.Spell.IsReady("Lacerate") and ccR.Player.Has.Talent("Pulverize") and ccR.Player.HasBuff("Pulverize") and ccR.Player.BuffDuration("Pulverize") <= 4.5 and not ccR.Target.Has.MyDebuff("Lacerate") then ccR.Cast.Attack("Lacerate") end
		if ccR.Spell.IsReady("Incarnation") and ccR.Player.Has.Talent("Incarnation") then ccR.Cast.Spell("Incarnation") end
		if ccR.Spell.IsReady("Lacerate") and not ccR.Target.Has.MyDebuff("Lacerate") then ccR.Cast.Attack("Lacerate") end
		if ccR.Spell.IsReady("Thrash") and ccR.Player.Count(8) >= 1 and not ccR.Target.Has.MyDebuff("Thrash") then ccR.Cast.Spell("Thrash") end
		if ccR.Spell.IsReady("Mangle") then ccR.Cast.Attack("Mangle") end
		if ccR.Spell.IsReady("Thrash") and ccR.Player.Count(8) >= 1 and ccR.Target.Has.MyDebuff("Thrash") and ccR.Target.MyDebuffDuration("Thrash") <= 4.8 then ccR.Cast.Spell("Thrash") end
		if ccR.Spell.IsReady("Lacerate") then ccR.Cast.Attack("Lacerate") end
	end	
end